import axios from 'axios';
// REACT_APP_RECORDS_API_URL=http://5b67a538f793e000145625fa.mockapi.io/api/v2/records
const api = process.env.REACT_APP_RECORDS_API_URL || 'http://localhost:5000'

export const getRecords = ()=>
    axios.get(`${api}/api/v2/records`)

export const submitRecord = (body)=>
    axios.post(`${api}/api/v2/records`,body)

export const updateRecord = (id,body)=>
    axios.put(`${api}/api/v2/records/${id}`,body)

export const deleteRecord = (id)=>
    axios.delete(`${api}/api/v2/records/${id}`)